const CryptoJS = require('crypto-js');


function hae(a){
    return CryptoJS.MD5(a).toString()
}

function getSign(e) {
    delete e.sign;
    for (var t = [], n = Object.keys(e).sort(), r = 0; r < n.length; r++) {
        var i = n[r]
            , a = e[i];
        t.push(i),
            t.push(a)
    }
    t.push("iIndex");
    var s = t.join("_")
        , c = hae(s);
    return c
};

function decrypt(r, lastFetchTime) {
    var i = CryptoJS.enc.Utf8.parse(lastFetchTime + "000")
        , a = CryptoJS.enc.Utf8.parse(lastFetchTime + "000")
        , s = CryptoJS.AES.decrypt(r.toString(), i, {
        iv: a
    })
    var c = s.toString(CryptoJS.enc.Utf8)
    return JSON.parse(c)
}

// t = {
//     // "channel": "varietylist",
// }
// console.log(getSign(t));


